home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ws_ping.zip / WSPI_SRC.ZIP / WS_PING.H < prev    next >
C/C++ Source or Header  |  1994-01-20  |  3KB  |  93 lines

  1. /***************************************************************************
  2.   Windows Sockets PING Client Application Header File
  3.  
  4.   Written by:
  5.       John A. Junod             Internet: <junodj@css583.gordon.army.mil>
  6.       267 Hillwood Street                 <zj8549@trotter.usma.edu>
  7.       Martinez, GA 30907      Compuserve: 72321,366 
  8.  
  9.   This program executable and all source code is released into the public
  10.   domain.  It would be nice to give me a little credit for any use of this 
  11.   code.  The primary purpose of this application was to learn what it takes
  12.   to write a Windows Sockets Application.
  13.  
  14. *****************************************************************************/
  15. /*
  16.   MODULE: WS_PING.H   (main program header file)
  17. */
  18.  
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <dir.h>
  22.  
  23. // **** Dialog box names
  24. // #define DLG_ABOUT                 510
  25. // #define DLG_HOST                  520
  26. // #define DLG_INPUT                 530
  27. // #define DLG_STATUS                540
  28.  
  29. // **** menu definitions
  30. // may be used by other functions!
  31.  
  32. #define IDM_CONNECT                 1010
  33. #define IDM_CLOSE                   1020
  34. #define IDM_ASYNC_CONNECT           1030
  35. #define IDM_ABOUT                   1500
  36. #define IDM_EXIT                    1600
  37. #define IDM_LOOKUP                  1601
  38.  
  39. #define WM_PING_HOST           WM_USER+1
  40. #define WM_PING_PROTO          WM_USER+2
  41. #define WM_PING_CAS            WM_USER+3
  42. #define WM_PING_RECEIVE        WM_USER+4
  43. #define WM_PING_FINISH         WM_USER+5
  44.  
  45. // **** main window child window identifiers
  46. // TXT = static text windows
  47. // LST = list boxes
  48. // BTN = push buttons
  49. // RB  = radio buttons
  50.  
  51. // input dialog controls
  52. #define DLG_PROMPT                  3010
  53. #define DLG_EDIT                    3020
  54.  
  55. // **** connect dialog box controls
  56. #define DLG_HOST_NAME               4010
  57. #define DLG_HOST_NUMPKTS            4020
  58. #define DLG_HOST_PKTLENGTH          4030
  59. #define DLG_HOST_TIMEOUT            4040
  60. #define DLG_HOST_VERBOSE            4050
  61.  
  62. // **** function prototypes
  63.  
  64. // in ws_error.c
  65. LPSTR ReturnWSError(UINT Err,LPSTR szBuf);
  66. void ReportWSError(UINT Err);
  67.  
  68. // in ws_ping.c
  69. LONG FAR PASCAL WndProc(HWND, WORD, WORD, LONG);
  70. BOOL FAR PASCAL WS_AboutMsgProc(HWND, WORD, WORD, LONG);
  71. BOOL FAR PASCAL WS_InputMsgProc(HWND, WORD, WORD, LONG);
  72. BOOL FAR PASCAL WS_HostMsgProc(HWND, WORD, WORD, LONG);
  73. int nCwRegisterClasses(void);
  74. void cwCenter(HWND, int);
  75. void CwUnRegisterClasses(void);
  76.  
  77. // in ws_paint.c
  78. void ReleaseDisplayMem(VOID);
  79. void DoAddLine(LPSTR);
  80. void DoPrintf(char *fmt,...);
  81. void DoPaint(HWND);
  82. int GetLocalInfo(void);
  83.  
  84. // ws_pingr.c
  85. LPSTR ReturnICMPType(int );
  86. int   PrintPkt(LPSTR ,int ,struct sockaddr_in FAR *,BOOL);
  87. int   in_cksum(u_short FAR *,int );
  88. SOCKET create_socket(struct sockaddr_in FAR *,LPSTR s);
  89. int   send_ping(SOCKET , struct sockaddr_in FAR *, LPSTR ,int );
  90. int   recv_ping(SOCKET ,LPSTR ,BOOL );
  91. int   PingHost(LPSTR ,int, int, int, BOOL);
  92. SOCKET DoClose(SOCKET);
  93.